﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Master/AdminMaster.Master" AutoEventWireup="true"
    CodeBehind="DistributionCompanyEdit.aspx.cs" Inherits="HZ.DrugTrade.Web.Admin.DistributionManage.DistributionCompanyEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script language="javascript">

        function func_insert() {
            var listbox1 = document.getElementById("ctl00_ContentPlaceHolder1_listbox1");
            var listbox2 = document.getElementById("ctl00_ContentPlaceHolder1_listbox2");

            for (i = listbox2.options.length - 1; i >= 0; i--) {
                if (listbox2.options(i).selected && !listbox2.options(i).disabled) {
                    option_text = listbox2.options(i).text;
                    option_value = listbox2.options(i).value;
                    option_style_color = listbox2.options(i).style.color;

                    var my_option = document.createElement("OPTION");
                    my_option.text = option_text;
                    my_option.value = option_value;
                    my_option.style.color = option_style_color;

                    listbox1.add(my_option);
                    listbox2.remove(i);
                }
            } //for
            set_rolesvalue();
        }

        function func_delete() {
            var listbox1 = document.getElementById("ctl00_ContentPlaceHolder1_listbox1");
            var listbox2 = document.getElementById("ctl00_ContentPlaceHolder1_listbox2");
            for (i = listbox1.options.length - 1; i >= 0; i--) {
                if (listbox1.options(i).selected && !listbox1.options(i).disabled) {
                    option_text = listbox1.options(i).text;
                    option_value = listbox1.options(i).value;

                    var my_option = document.createElement("OPTION");
                    my_option.text = option_text;
                    my_option.value = option_value;

                    listbox2.add(my_option);
                    listbox1.remove(i);
                }
            } //for
            set_rolesvalue();

        }

        function set_rolesvalue() {
            var listbox1 = document.getElementById("ctl00_ContentPlaceHolder1_ListBox1");
            var listbox2 = document.getElementById("ctl00_ContentPlaceHolder1_ListBox2");
            var companyId = document.getElementById("ctl00_ContentPlaceHolder1_hdnCompanyId");
            fld_str = "";
            for (i = 0; i < listbox1.options.length; i++) {
                options_value = listbox1.options(i).value;
                fld_str += options_value + ",";
            }
            companyId.value = fld_str;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tabnav">
        <ul>
            <li class="active"><a href="javascript:void(0);">管理医药配送企业</a></li>
        </ul>
    </div>
    <div class="maincon">
        <div id="note">
            医疗机构基本信息</div>
        <div id="note2">
        </div>
        <table>
            <tr>
                <th align="right" width="20%">
                    <asp:Label ID="lblProdctNameTag" runat="server" Text="医疗机构名称："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblHospitalName" runat="server"></asp:Label>
                </td>
                <th align="right" width="20%">
                    <asp:Label ID="lblGoodsNameTag" runat="server" Text="所在区域："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblArea" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <th align="right">
                    <asp:Label ID="lblMedicineModelNameTag" runat="server" Text="地址："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblHospitalAddress" runat="server"></asp:Label>
                </td>
                <th align="right">
                    &nbsp;
                </th>
                <td align="left">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <th align="right">
                    <asp:Label ID="lblCompany_ZBTag" runat="server" Text="联系人："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblContactPerson" runat="server"></asp:Label>
                </td>
                <th align="right">
                    <asp:Label ID="lblCompany_SCTag" runat="server" Text="联系电话："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblContactTel" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
    <div class="listcon">
        <div class="note">
            医疗机构的配送企业</div>
        <div class="note2">
        </div>
        <table class="querylist">
            <tr>
                <th>
                    现有配送企业
                </th>
                <td width="40px">
                    &nbsp;
                </td>
                <th>
                    可配送企业
                </th>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:ListBox ID="ListBox1" onchange="preventSelectDisabled(this)" runat="server"
                        Width="280px" Height="180px"></asp:ListBox>
                        <br />
              <span  style="color: #888888">“在使用”的配送企业无法删除。</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

                        
                </td>
                <td width="60px">
                    <input type="button" title="新增配送企业" value=" ← " onclick="func_insert();" /><br />
                    <input id="Button2" title="移除配送企业" type="button" value=" → " onclick="func_delete();" />
                    <input id="hdnCompanyId" type="hidden" runat="server" />
                    <input id="hdnUsingCompanyId" type="hidden" runat="server" />
                </td>
                <td align="left" valign="top">
                    <asp:ListBox ID="ListBox2" onchange="preventSelectDisabled(this)" ToolTip="可使用shift或ctrl键选择多项"
                        runat="server" Width="280px" SelectionMode="Multiple" Height="180px"></asp:ListBox>
                    <br />
                    <span style="color: #888888">可使用shift或ctrl键选择多项</span> &nbsp;
                </td>
            </tr>
        </table>
        <div class="listip">
            <ul>
                <li>说明:<span> <font color="red">离开页面前请注意“保存”</font></span></li>
            </ul>
        </div>
        <div class="listctrl">
            <hz:HzButton ID="btnSave" runat="server" Text="保存" CssClass="btn" 
                OnClick="btnSave_Click" OperateType="编辑" />
            &nbsp;
            <input type="button" class="btn" value="返回" onclick="javascript:history.back();" /><br />
        </div>
    </div>
</asp:Content>
